<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: CTimeTools类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="class_c_time_tools-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">CTimeTools类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>时间工具类  
 <a href="class_c_time_tools.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_time_8h_source.html">Time.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:ae7e9e7975853b76ea96592a5d40d33d0"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_time_tools.html#ae7e9e7975853b76ea96592a5d40d33d0">GetDateTimeStr</a> (<a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a> chDate='-', <a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a> chBoth=' ', <a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a> chTime=':', <a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a> chMill='.')</td></tr>
<tr class="memdesc:ae7e9e7975853b76ea96592a5d40d33d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前日期时间字符串精确到毫秒  <a href="class_c_time_tools.html#ae7e9e7975853b76ea96592a5d40d33d0">更多...</a><br /></td></tr>
<tr class="separator:ae7e9e7975853b76ea96592a5d40d33d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade52c34673cca32faab3ac984e1b40c5"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_time_tools.html#ade52c34673cca32faab3ac984e1b40c5">GetDateStr</a> (<a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a> chDate='-')</td></tr>
<tr class="memdesc:ade52c34673cca32faab3ac984e1b40c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前日期字符串(年月日时分秒毫秒)  <a href="class_c_time_tools.html#ade52c34673cca32faab3ac984e1b40c5">更多...</a><br /></td></tr>
<tr class="separator:ade52c34673cca32faab3ac984e1b40c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86ff8e1d027ce0f6bc7611c430672f73"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_time_tools.html#a86ff8e1d027ce0f6bc7611c430672f73">GetTimeStr</a> (<a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a> chTime=':', <a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a> chMill='.')</td></tr>
<tr class="memdesc:a86ff8e1d027ce0f6bc7611c430672f73"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前时间字符串(年月日时分秒毫秒)  <a href="class_c_time_tools.html#a86ff8e1d027ce0f6bc7611c430672f73">更多...</a><br /></td></tr>
<tr class="separator:a86ff8e1d027ce0f6bc7611c430672f73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d93d6b3299429b2e08f10a58b52f7bc"><td class="memItemLeft" align="right" valign="top">static tm *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_time_tools.html#a3d93d6b3299429b2e08f10a58b52f7bc">GetCTimeInfo</a> (tm *tinfo)</td></tr>
<tr class="memdesc:a3d93d6b3299429b2e08f10a58b52f7bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前时间信息  <a href="class_c_time_tools.html#a3d93d6b3299429b2e08f10a58b52f7bc">更多...</a><br /></td></tr>
<tr class="separator:a3d93d6b3299429b2e08f10a58b52f7bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa47fa922fa6426ab5fbb1da1203df602"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_time_8h.html#af2a6744cb9d94e30fdd245a100a94ecf">PDateTime</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_time_tools.html#aa47fa922fa6426ab5fbb1da1203df602">GetTimeInfo</a> (<a class="el" href="_time_8h.html#af2a6744cb9d94e30fdd245a100a94ecf">PDateTime</a> tinfo)</td></tr>
<tr class="memdesc:aa47fa922fa6426ab5fbb1da1203df602"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前时间信息  <a href="class_c_time_tools.html#aa47fa922fa6426ab5fbb1da1203df602">更多...</a><br /></td></tr>
<tr class="separator:aa47fa922fa6426ab5fbb1da1203df602"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9cac1735bbfdc48f8c70c3acb7bd4ba"><td class="memItemLeft" align="right" valign="top">static long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_time_tools.html#ab9cac1735bbfdc48f8c70c3acb7bd4ba">GetDateValue</a> (time_t *t)</td></tr>
<tr class="memdesc:ab9cac1735bbfdc48f8c70c3acb7bd4ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">从当前或者传入的时间值中获取当前日期值  <a href="class_c_time_tools.html#ab9cac1735bbfdc48f8c70c3acb7bd4ba">更多...</a><br /></td></tr>
<tr class="separator:ab9cac1735bbfdc48f8c70c3acb7bd4ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>时间工具类 </p>

<p class="definition">在文件 <a class="el" href="_time_8h_source.html">Time.h</a> 第 <a class="el" href="_time_8h_source.html#l00029">29</a> 行定义.</p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a3d93d6b3299429b2e08f10a58b52f7bc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d93d6b3299429b2e08f10a58b52f7bc">&#9670;&nbsp;</a></span>GetCTimeInfo()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">tm * CTimeTools::GetCTimeInfo </td>
          <td>(</td>
          <td class="paramtype">tm *&#160;</td>
          <td class="paramname"><em>tinfo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取当前时间信息 </p>

<p class="definition">在文件 <a class="el" href="_time_8cpp_source.html">Time.cpp</a> 第 <a class="el" href="_time_8cpp_source.html#l00099">99</a> 行定义.</p>

</div>
</div>
<a id="ade52c34673cca32faab3ac984e1b40c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade52c34673cca32faab3ac984e1b40c5">&#9670;&nbsp;</a></span>GetDateStr()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string CTimeTools::GetDateStr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a>&#160;</td>
          <td class="paramname"><em>chDate</em> = <code>'-'</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取当前日期字符串(年月日时分秒毫秒) </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">chDate</td><td>日期之间的分割符 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回格式化后的字符串日期 </dd></dl>
<dl class="section remark"><dt>备注</dt><dd>如果某个参数传入为0，则不使用分割符(yyyy-mm-dd) </dd></dl>

<p class="definition">在文件 <a class="el" href="_time_8cpp_source.html">Time.cpp</a> 第 <a class="el" href="_time_8cpp_source.html#l00049">49</a> 行定义.</p>

</div>
</div>
<a id="ae7e9e7975853b76ea96592a5d40d33d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7e9e7975853b76ea96592a5d40d33d0">&#9670;&nbsp;</a></span>GetDateTimeStr()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string CTimeTools::GetDateTimeStr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a>&#160;</td>
          <td class="paramname"><em>chDate</em> = <code>'-'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a>&#160;</td>
          <td class="paramname"><em>chBoth</em> = <code>'&#160;'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a>&#160;</td>
          <td class="paramname"><em>chTime</em> = <code>':'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a>&#160;</td>
          <td class="paramname"><em>chMill</em> = <code>'.'</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取当前日期时间字符串精确到毫秒 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">chDate</td><td>日期之间的分割符 </td></tr>
    <tr><td class="paramname">chBoth</td><td>日期和时间之间的分割符 </td></tr>
    <tr><td class="paramname">chTime</td><td>时间之间的分割符 </td></tr>
    <tr><td class="paramname">chMill</td><td>时间与毫秒之间的分割符 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回格式化后的字符串 </dd></dl>
<dl class="section remark"><dt>备注</dt><dd>如果某个参数传入为0，则不使用分割符(yyyy-mm-dd hh:mm:ss.mmm) </dd></dl>

<p class="definition">在文件 <a class="el" href="_time_8cpp_source.html">Time.cpp</a> 第 <a class="el" href="_time_8cpp_source.html#l00011">11</a> 行定义.</p>

</div>
</div>
<a id="ab9cac1735bbfdc48f8c70c3acb7bd4ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab9cac1735bbfdc48f8c70c3acb7bd4ba">&#9670;&nbsp;</a></span>GetDateValue()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">long CTimeTools::GetDateValue </td>
          <td>(</td>
          <td class="paramtype">time_t *&#160;</td>
          <td class="paramname"><em>t</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>从当前或者传入的时间值中获取当前日期值 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">t</td><td>传入的当前时间值 (time函数获取) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回日期值 格式参考:20190523 </dd></dl>
<dl class="section remark"><dt>备注</dt><dd>若t为null，则函数自动获取当前的时间 </dd></dl>

<p class="definition">在文件 <a class="el" href="_time_8cpp_source.html">Time.cpp</a> 第 <a class="el" href="_time_8cpp_source.html#l00110">110</a> 行定义.</p>

</div>
</div>
<a id="aa47fa922fa6426ab5fbb1da1203df602"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa47fa922fa6426ab5fbb1da1203df602">&#9670;&nbsp;</a></span>GetTimeInfo()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_time_8h.html#af2a6744cb9d94e30fdd245a100a94ecf">PDateTime</a> CTimeTools::GetTimeInfo </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_time_8h.html#af2a6744cb9d94e30fdd245a100a94ecf">PDateTime</a>&#160;</td>
          <td class="paramname"><em>tinfo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取当前时间信息 </p>

<p class="definition">在文件 <a class="el" href="_time_8cpp_source.html">Time.cpp</a> 第 <a class="el" href="_time_8cpp_source.html#l00131">131</a> 行定义.</p>

</div>
</div>
<a id="a86ff8e1d027ce0f6bc7611c430672f73"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a86ff8e1d027ce0f6bc7611c430672f73">&#9670;&nbsp;</a></span>GetTimeStr()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string CTimeTools::GetTimeStr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a>&#160;</td>
          <td class="paramname"><em>chTime</em> = <code>':'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_find_file_8h.html#a37cc1038758216808d5f75090b093c9a">int</a>&#160;</td>
          <td class="paramname"><em>chMill</em> = <code>'.'</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取当前时间字符串(年月日时分秒毫秒) </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">chTime</td><td>时间之间的分割符 </td></tr>
    <tr><td class="paramname">chMill</td><td>时间与毫秒之间的分割符 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回格式化后的字符串时间 </dd></dl>
<dl class="section remark"><dt>备注</dt><dd>如果某个参数传入为0，则不使用分割符(hh-mm-ss.mmm) </dd></dl>

<p class="definition">在文件 <a class="el" href="_time_8cpp_source.html">Time.cpp</a> 第 <a class="el" href="_time_8cpp_source.html#l00072">72</a> 行定义.</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>H:/project/LibTools/src/time/<a class="el" href="_time_8h_source.html">Time.h</a></li>
<li>H:/project/LibTools/src/time/<a class="el" href="_time_8cpp_source.html">Time.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
